<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Cache-Control" content="no-siteapp">
<link rel="stylesheet" href="../../../static/layui/css/layui.css"
	media="all" />
<link rel="stylesheet" href="../../../static/css/public.css" media="all" />
</head>
<body class="childrenBody">
	<form class="layui-form" lay-filter="formTest" id="form"
		style="width: 80%;">
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">实际收取时间</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" id="actecDate" name="actecDate" lay-verify="required|date" maxsize="32" placeholder="实际收取时间">
			</div>
		</div>
<!--		<div class="layui-form-item layui-row layui-col-xs12">-->
<!--			<label class="layui-form-label">应收时间</label>-->
<!--			<div class="layui-input-block">-->
<!--				<input type="text" class="layui-input" id="needrecDate" name="needrecDate" lay-verify="required|date" maxsize="32" placeholder="应收时间">-->
<!--			</div>-->
<!--		</div>-->
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">收入名称</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" id="cptname" name="cptname" lay-verify="required" maxsize="32" placeholder="收入名称">
			</div>
		</div>

		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">账号名</label>
			<div class="layui-input-block">
				<select id="cpttpid" name="cpttype"></select>
			</div>
		</div>



		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">收款金额</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" lay-verify="required|number" placeholder="收款金额" id="received" name="received">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">描述</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input"  placeholder="备注" placeholder="" id="descb" name="descb">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<div class="layui-input-block">
				<button type="button" class="layui-btn layui-btn-sm" lay-submit=""
					lay-filter="submit">提交</button>
				<button type="button"
					class="layui-btn layui-btn-sm layui-btn-primary close-btn">取消</button>
			</div>
		</div>
	</form>
	<script type="text/javascript"
		src="../../../static/js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../../static/layui/layui.js"></script>
	<script type="text/javascript"
		src="../../../static/custom/js/common.js"></script>
	<script type="text/javascript">
	
 	let cptpInuseApi = "../../../accounting/cwReceivables/selectCpttype";
 
	
		layui.use([ 'form', 'laydate', 'layer' ], function() {
			var form = layui.form;
			var laydate = layui.laydate;
			var layer = parent.layer === undefined ? layui.layer : top.layer, $ = layui.jquery;
			
			var updateApi = "../../../accounting/cwReceivables/update";

			
			var id = getUrlParam("id");
			// laydate.render({
			// 	elem : '#needrecDate'
			// });
			// console.log(id);
			$("#form").append("<input type='hidden' name='id' value='"+id+"' >");
			//初始化日期

			//初始化日期
			laydate.render({
				elem : '#actecDate'
			});

			form.on("submit(submit)", function(data) {
				loadAjax( updateApi, "put", $("#form").serialize(), function(response) {
					baseCallBack(response, parentReloadCallBack);
				});
				return false;
			})
			loadAjax(cptpInuseApi,"get",null,function(res){

				$.each(res.data,(i,e)=>{
					$("<option value='"+e.id+"'>"+e.cpttpname+"</option>").appendTo($("#cpttpid"));
				})

				form.render();
			});



		})
		
	         
            
 				
          
			
			 
	</script>
</body>
</html>